package com.example.demo.database;

import com.example.demo.database.services.base.BaseKernel;
import com.example.demo.database.services.base.SqlCompiler;
import com.example.demo.database.services.mysql.MySqlCompiler;
import com.example.demo.database.services.mysql.MySqlConnector;
import com.example.demo.database.services.mysql.MySqlKernel;
import gaarason.database.contract.eloquent.Record;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;

@RunWith(SpringRunner.class)
@SpringBootTest
@FixMethodOrder(MethodSorters.JVM)
public class Kernel extends MySqlKernel {
    @Value("${spring.datasource.username}")
    private String username;
    @Value("${spring.datasource.password}")
    private String password;
    @Value("${spring.datasource.url}")
    private String url;

    @Override
    public boolean strictUpMode() {
        return true;
    }

    @Override
    public String getUrl() {
        return url;
    }

    @Override
    public String getUserName() {
        return username;
    }

    @Override
    public String getPassword() {
        return password;
    }

    @Override
    public String scanPath() {
        return "com.example.demo.database.migration";
    }

    @Test
    @Override
    public void up() {
        super.up();
    }

    @Test
    @Override
    public void down() {
        super.down();
    }

}
